package cn.jieruoda.eb.user.domain.repository;

import cn.jieruoda.eb.user.domain.entity.UserToken;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.time.LocalDateTime;
import java.util.List;
import java.util.Optional;

@Repository
public interface UserTokenRepository extends JpaRepository<UserToken, Integer> {
    Optional<UserToken> findByUidAndType(Integer uid, Boolean type);
    List<UserToken> findByUidAndExpiresTimeAfter(Integer uid, LocalDateTime now);
    Optional<UserToken> findByTokenAndType(String token, Boolean type);
} 